home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 … to May: Technology Seed / April-May ADC Seed.toast / FireWire 1.1 DR2 SDK / Interfaces / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-15  |  10.2 KB  |  331 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    xxx put contents here xxx
  5.  
  6.      Version:    xxx put the technology version here xxx
  7.  
  8.      DRI:        Pradeep Kathail
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            SuperMario Build Daemon
  17.                  With Interfacer:    2.0d10   (PowerPC native)
  18.                  From:                DriverFamilyMatching.i
  19.                      Revision:        12
  20.                      Dated:            2/15/96
  21.                      Last change by:    PK
  22.                      Last comment:    Rename Maxwell Descriptor and add function calls to load and
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __DRIVERFAMILYMATCHING__
  29. #define __DRIVERFAMILYMATCHING__
  30.  
  31. #ifndef __TYPES__
  32. #include <Types.h>
  33. #endif
  34. #ifndef __NAMEREGISTRY__
  35. #include <NameRegistry.h>
  36. #endif
  37. #ifndef __CODEFRAGMENTS__
  38. #include <CodeFragments.h>
  39. #endif
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT_SUPPORTED
  46. #pragma import on
  47. #endif
  48.  
  49. #if PRAGMA_ALIGN_SUPPORTED
  50. #pragma options align=mac68k
  51. #endif
  52.  
  53. /* Please refer to Devices.i for DriverDescriptor definition for Marconi */
  54. //zzz#if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  55. /*zzz*/
  56. #if 0
  57. /*zzz*/
  58. /*
  59. #########################################################
  60.  Descriptor for Drivers and NDRVs
  61. #########################################################
  62. */
  63. /* Driver Typing Information Used to Match Drivers With Devices */
  64. struct DriverType {
  65.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  66.     NumVersion                         version;                    /* Driver Version Number*/
  67. };
  68. typedef struct DriverType DriverType;
  69.  
  70. typedef DriverType *DriverTypePtr;
  71. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  72. typedef OptionBits RuntimeOptions;
  73.  
  74. enum {
  75.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  76.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  77.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  78.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  79.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  80.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  81.     kDriverIsForVirtualDevice    = 0x00000040                    /* Driver is for a virtual Device */
  82. };
  83.  
  84. struct DriverOSRuntime {
  85.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  86.     Str31                             driverName;                    /* Driver's name to the OS*/
  87.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  88. };
  89. typedef struct DriverOSRuntime DriverOSRuntime;
  90.  
  91. typedef DriverOSRuntime *DriverOSRuntimePtr;
  92. /* OS Service Information Used To Declare What APIs a Driver Supports */
  93. typedef UInt32 ServiceCount;
  94. struct DriverServiceInfo {
  95.     OSType                             serviceCategory;            /* Service Category Name*/
  96.     OSType                             serviceType;                /* Type within Category*/
  97.     NumVersion                         serviceVersion;                /* Version of service*/
  98. };
  99. typedef struct DriverServiceInfo DriverServiceInfo;
  100.  
  101. typedef DriverServiceInfo *DriverServiceInfoPtr;
  102. struct DriverOSService {
  103.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  104.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  105. };
  106. typedef struct DriverOSService DriverOSService;
  107.  
  108. typedef DriverOSService *DriverOSServicePtr;
  109. /* Categories */
  110.  
  111. enum {
  112.     kServiceCategoryDisplay        = 'disp',                        /* Display Manager*/
  113.     kServiceCategoryOpenTransport = 'otan',                        /* Open Transport*/
  114.     kServiceCategoryBlockStorage = 'blok',                        /* Block Storage*/
  115.     kServiceCategoryNdrvDriver    = 'ndrv',                        /* Generic Native Driver*/
  116.     kServiceCategoryScsiSIM        = 'scsi',                        /* SCSI */
  117.     kServiceCategoryFileManager    = 'file',                        /* File Manager */
  118.     kServiceCategoryIDE            = 'ide-',                        /* ide */
  119.     kServiceCategoryADB            = 'adb-',                        /* adb */
  120.     kServiceCategoryPCI            = 'pci-',                        /* pci bus */
  121.                                                                 /* Nu Bus */
  122.     kServiceCategoryPCMCIA        = 'pcmc',                        /* PCMCIA */
  123.     kServiceCategoryDFM            = 'dfm-',                        /* DFM */
  124.     kServiceCategoryMotherBoard    = 'mrbd',                        /* mother Board */
  125.     kServiceCategoryKeyboard    = 'kybd',                        /* Keyboard */
  126.     kServiceCategoryPointing    = 'poit',                        /* Pointing */
  127.     kServiceCategoryRTC            = 'rtc-',                        /* RTC */
  128.     kServiceCategoryNVRAM        = 'nram',                        /* NVRAM */
  129.     kServiceCategorySound        = 'sond',                        /* Sound (1/3/96 MCS) */
  130.     kServiceCategoryPowerMgt    = 'pgmt',                        /* Power Management */
  131.     kServiceCategoryGeneric        = 'genr'                        /* Generic Service Category to receive general Events */
  132. };
  133.  
  134. /* Ndrv ServiceCategory Types */
  135.  
  136. enum {
  137.     kNdrvTypeIsGeneric            = 'genr',                        /* generic*/
  138.     kNdrvTypeIsVideo            = 'vido',                        /* video*/
  139.     kNdrvTypeIsBlockStorage        = 'blok',                        /* block storage*/
  140.     kNdrvTypeIsNetworking        = 'netw',                        /* networking*/
  141.     kNdrvTypeIsSerial            = 'serl',                        /* serial*/
  142.     kNdrvTypeIsSound            = 'sond',                        /* sound*/
  143.     kNdrvTypeIsBusBridge        = 'brdg'
  144. };
  145.  
  146. typedef UInt32 DriverDescVersion;
  147. /*    The Driver Description */
  148.  
  149. enum {
  150.     kInitialDriverDescriptor    = 0,
  151.     kVersionOneDriverDescriptor    = 1
  152. };
  153.  
  154.  
  155. enum {
  156.     kTheDescriptionSignature    = 'mtej',
  157.     kDriverDescriptionSignature    = 'pdes'
  158. };
  159.  
  160. struct DriverDescription {
  161.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  162.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  163.     DriverType                         driverType;                    /* Type of Driver*/
  164.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  165.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  166. };
  167. typedef struct DriverDescription DriverDescription;
  168.  
  169. typedef DriverDescription *DriverDescriptionPtr;
  170. /*zzz*/
  171. #endif
  172. /*zzz*/
  173. //zzz#endif
  174.  
  175. //zzz#if FOR_SYSTEM8_PREEMPTIVE
  176. /*
  177. ################################################
  178.  Family Matching Data Structure
  179. ################################################
  180. */
  181. /*    The Family Type */
  182.  
  183. enum {
  184.     kFamilyIsHighLevel            = 0,                            /* High Level Family */
  185.     kFamilyIsLowLevel            = 1                                /* Low Level Family  */
  186. };
  187.  
  188. typedef UInt32 FamilyLevel;
  189. /* Family Typing Information Used to Match Families With plug-ins and Devices */
  190. struct FamilyType {
  191.     FamilyLevel                     familyLevel;                /* Kind of Family */
  192.     OSType                             familyName;                    /* Family Name */
  193.     NumVersion                         version;                    /* Family Version Number*/
  194.     OSType                             reserved;                    /* Used by Mother Board Expert */
  195. };
  196. typedef struct FamilyType FamilyType;
  197.  
  198. typedef FamilyType *FamilyTypePtr;
  199.  
  200. enum {
  201.     kFamilyIsLoadedAtBoot        = 0x00000001,                    /* Family is loaded at the boot time */
  202.     kFamilyIsLoadedUponDiscovery = 0x00000002,                    /* auto-load Family when discovered */
  203.     kFamilyIsStartedAtBoot        = 0x00000004                    /* Family is initialized at the Boot */
  204. };
  205.  
  206. typedef UInt32 FamilyOSRunTimeOptions;
  207. struct FamilyOSRunTime {
  208.     FamilyOSRunTimeOptions             familyRuntime;                /* Options for OS Runtime*/
  209.     Str31                             familyName;                    /* Family's name to the OS*/
  210.     UInt32                             familyDescReserved[8];        /* Reserved area*/
  211. };
  212. typedef struct FamilyOSRunTime FamilyOSRunTime;
  213.  
  214. typedef FamilyOSRunTime *FamilyOSRunTimePtr;
  215. /*    The Family Description */
  216.  
  217. enum {
  218.     kFamilyDescriptionSignature    = 'fdes'
  219. };
  220.  
  221. typedef UInt32 FamilyDescVersion;
  222.  
  223. enum {
  224.     kInitialFamilyDescriptor    = 0,
  225.     kMotherBoardDescriptor        = 1
  226. };
  227.  
  228. typedef UInt32 DependencyCount;
  229. struct MatchingAndDependencyInfo {
  230.     union {
  231.         Str31                             deviceName;                /* the device name to match */
  232.         OSType                             dependency;                /* Dependency List */
  233.     }                                 u;
  234. };
  235. typedef struct MatchingAndDependencyInfo MatchingAndDependencyInfo;
  236.  
  237. typedef MatchingAndDependencyInfo *MatchingAndDependencyInfoPtr;
  238. struct FamilyMatchingAndDependency {
  239.     DependencyCount                 nrElements;                    /* Number of elements in the Array */
  240.     MatchingAndDependencyInfo         matchingInfo[1];
  241. };
  242. typedef struct FamilyMatchingAndDependency FamilyMatchingAndDependency;
  243.  
  244. typedef FamilyMatchingAndDependency *FamilyMatchingAndDependencyPtr;
  245. struct FamilyDescription {
  246.     OSType                             familyDescSignature;        /* Signature field of this structure*/
  247.     FamilyDescVersion                 familyDescVersion;            /* Version of this data structure*/
  248.     FamilyType                         familyType;                    /* Type of Driver*/
  249.     FamilyOSRunTime                 familyOSRuntime;            /* OS Runtime Requirements of Family */
  250.     FamilyMatchingAndDependency     familymatchingAndDependency; /* Family Dependency Info */
  251.  
  252. };
  253. typedef struct FamilyDescription FamilyDescription;
  254.  
  255. typedef FamilyDescription *FamilyDescriptionPtr;
  256. /*
  257. ##############################################
  258.  Definition of "driver-ptr" property
  259. ##############################################
  260. */
  261. struct DriverPtrProperty {
  262.     LogicalAddress                     pluginLocator;
  263.     UInt32                             length;
  264. };
  265. typedef struct DriverPtrProperty DriverPtrProperty;
  266.  
  267. typedef DriverPtrProperty *DriverPtrPropertyPtr;
  268. /*
  269. ##############################################
  270.  Status Definition for DFMReportInitStatus
  271. ##############################################
  272. */
  273.  
  274. enum {
  275.     kInitStatusOK                = 0,
  276.     kInitStatusNotOK            = 1
  277. };
  278.  
  279. /*
  280. ##############################################
  281.  Declare the pluginLoadID
  282. ##############################################
  283. */
  284. typedef struct OpaquePluginLoadID* PluginLoadID;
  285. /*
  286. ##############################################
  287.  Function Prototypes
  288. ##############################################
  289. */
  290. extern UInt32 DFMReportInitStatus(OSType serviceCategory, UInt32 status);
  291.  
  292. extern OSStatus DFMRemovePlugIns(RegEntryRef *device, OSType serviceCategory, UInt32 nrPlugIns, LogicalAddress *pluginLocatorsInUse);
  293.  
  294. //zzzextern OSStatus DFMLoadPlugin(LogicalAddress pluginLocator, ConstStr63Param pluginName, PluginLoadID *pluginLoadID, LogicalAddress *main, LogicalAddress *pluginDT, TextObject optErrMsg);
  295.  
  296. extern OSStatus DFMUnloadPlugin(PluginLoadID *pluginLoadID);
  297.  
  298. extern OSStatus DFMGetCFragConnectID(PluginLoadID *pluginLoadID, CFragConnectionID *connectionID);
  299.  
  300. /*
  301. ##############################################
  302.  Well known properties in the Name Registry
  303. ##############################################
  304. */
  305.  
  306. #define kPropertyName                    "name"
  307. #define kPropertyCompatible                "compatible"
  308. #define    kPropertyDriverPtr                "driver-ptr"
  309. #define kPropertyDriverDesc                "driver-description"
  310. #define kPropertyReg                    "reg"
  311. #define kPropertyAAPLAddress            "AAPL,address"
  312. #define kPropertyMatching                "matching"
  313.  
  314. /* CPassThru */
  315. //zzz#endif
  316.  
  317. #if PRAGMA_ALIGN_SUPPORTED
  318. #pragma options align=reset
  319. #endif
  320.  
  321. #if PRAGMA_IMPORT_SUPPORTED
  322. #pragma import off
  323. #endif
  324.  
  325. #ifdef __cplusplus
  326. }
  327. #endif
  328.  
  329. #endif /* __DRIVERFAMILYMATCHING__ */
  330.  
  331.